<template>
    <el-dialog title="服务状态" :visible.sync="show">
        <div class="box">
            <zyTableS :tableData="arr" :tableColumn="tableColumn" />
        </div>
    </el-dialog>
</template>
<script>
import zyTableS from '@/components/common/zyTableS.vue'
import { tableColumn } from './formConfig'
export default {
    data() {
        return {
            show: false,
            arr: [],
            tableColumn: [],
        }
    },
    components: {
        zyTableS,
    },
    methods: {
        openDialog(e) {
            this.arr = []
            let jsonObject = JSON.parse(e)

            jsonObject.forEach((e) => {
                this.arr.push({
                    label: e[0],
                    port: e[1],
                    server_state: e[2],
                    msg: e[3],
                    time: e[4],
                })
            })

            this.show = true
        },
        closeDialog() {
            this.show = false
        },
    },
    created() {
        this.tableColumn = tableColumn
    },
}
</script>

<style lang="less" scoped>
.box {
    height: 40vh;
}
</style>
